package com.hqyj.controller;


import com.hqyj.pojo.PaperInfo;
import com.hqyj.pojo.R;
import com.hqyj.service.PaperInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author rock
 * @since 2022-10-31 01:49:30
 */
@RestController
@RequestMapping("/paper-info")
public class PaperInfoController {

    @Autowired
    PaperInfoService paperInfoService;

    //试卷生成
    @PostMapping("/add")
    public R add(PaperInfo paper){
        return paperInfoService.createPaper(paper);
    }

    //试卷预览
    @PostMapping("/paperShow")
    public R paperShow(String paperName){
        return paperInfoService.paperShow(paperName);
    }

    //查询试卷
    @PostMapping("/queryPaper")
    public R queryPaper(String paperName){
        return paperInfoService.queryPaper(paperName);
    }

    //试卷评分
    @PostMapping("/countPaper")
    public R countPaper(String paperName,String s,String m,String j)
    {
        return paperInfoService.countPaper(paperName,s,m,j);
    }

}

